<template>
  <view class="set">
    <view class="main">
      <view class="list"  @click="go_url('./information')">
        个人资料
        <uni-icons type="arrowright" size="24" color="#999" />
      </view>
      <view class="list" @click="go_clear()">
        清除缓存
        <uni-icons type="arrowright" size="24" color="#999" />
      </view>
    </view>
    <view class="button" @click="out()">
      退出登录
    </view>
  </view>
</template>
<script>
import { uniIcons } from '@dcloudio/uni-ui';
export default {
	components: { uniIcons },
	data() {
		return {
			msg_list: [
				{
					id: 5,
					checked: false
				}
			],
			compile: false,
			is_go_top: false,
			is_all: false
		};
	},
	methods: {
		go_url(url) {
			uni.navigateTo({
			    url: url
			});
		},
		/* 不清理登录缓存信息 */
		go_clear(){
			uni.getStorage({
			    key: 'login',
			    success: function (res) {
					// uni.clearStorage();
					// uni.setStorage({
					//     key: 'login',
					//     data: res.data,
					//     success: function () {
					// 		uni.showToast({
					// 		    title: '缓存清理成功',
					// 		    duration: 2000
					// 		});
					//     }
					// });
					uni.showToast({
					    title: '缓存清理成功',
					    duration: 2000
					});
			    }
			});
			
			
		},
		out(){
			uni.clearStorage();
			uni.removeStorageSync('agentinfo')
			uni.removeStorageSync('mr');
			uni.redirectTo({
			    url: '../account/login'
			});
		}
	}
};
</script>
<style lang="less" scoped>
.set {
  height: 100%;
  .main {
    background: #fff;
    padding: 0 20rpx;
    .list {
      line-height: 110rpx;
      font-size: 30rpx;
      border-bottom: 1rpx solid #e1e1e1; /*no*/
      .uni-icons {
        float: right;
      }
    }
    .list:nth-last-child(1) {
      border-bottom: none;
    }
  }
  .button {
    position: absolute;
    bottom: 137rpx;
    left: 20rpx;
    right: 20rpx;
    line-height: 90rpx;
    background: #e1e1e1;
    text-align: center;
    color: #666666;
    border-radius: 45rpx;
    font-size: 32rpx;
    box-shadow: 3rpx 0 20rpx rgba(206, 205, 204, 0.35);
  }
}
</style>
